import request from "@/utils/request";
import { remoteRequest } from '@/utils/remote.js'

// 获取列表
export function getAllList(query) {
  return request({
    url: "/earEveManage/getPage",
    method: "get",
    params: query,
  });
}

// 获取列表
export function getAllList1(query) {
  return request({
    url: "/earEveManage/getEarInfo",
    method: "get",
    params: query,
  });
}

// 获取地震信息编号及名称
export function getDataName(query) {
  return request({
    url: "/earEveManage/getEventName/",
    method: "get",
    params:query
  });
}

// 保存
export function saveData(data) {
  return request({
    url: "/earEveManage/save",
    method: "post",
    data:data
  });
}

// 修改
export function updateDate(data) {
  return request({
    url: "/earEveManage/update",
    method: "post",
    data:data
  });
}

// 查看
export function getDetail(id) {
  return request({
    url: "/earEveManage/findById",
    method: "get",
    params:id
  });
}

// 设为当前事件
export function setCurrentEvent(id) {
  return remoteRequest('setCurEvent', {id}, () => {
    return request({
      url: "/earEveManage/setCurEvent/"+id,
      method: "post",
    });
  })
}

// 获取当前事件
export function getCurrentEvent() {
  return request({
    url: "/earEveManage/getCurrentEvent",
    method: "get",
  });
}

//删除
export function del(id) {
  return request({
    url: "/earEveManage/delete/" + id,
    method: "post",
  });
}

// 地震事件转换
export function convert(data) {
  return request({
    url: "/earEveManage/convert",
    method: "post",
    data:data
  });
}
// 模拟地震事件按钮保存
export function simEarSave(data) {
  return request({
    url: "/earEveManage/simEarSave",
    method: "post",
    data:data
  });
}
// 模拟地震事件按钮修改
export function simEarUpdate(data) {
  return request({
    url: "/earEveManage/simEarUpdate",
    method: "post",
    data:data
  });
}
// 模拟地震事件按钮删除
export function simEarDelete(id) {
  return request({
    url: "/earEveManage/simEarDelete/" + id,
    method: "get",
  });
}

// 地震事件结束检查
export function endSeismicEventCheck(id) {
  return request({
    url: "/earEveManage/endSeismicEventCheck/" + id,
    method: "post",
  });
}
// 地震事件结束
export function endSeismicEvent(id) {
  return request({
    url: "/earEveManage/endSeismicEvent/" + id,
    method: "post",
  });
}